<?php include 'frame-top.php'; ?>

<?php 
$data = $this->data;
$data['Icon'] = empty($data['Icon'])?'default.gif':$data['Icon'];
?>

<form action="/member/update" method="post">
<div class="segm">
	<?php include 'pathbar.php';
	pathbar(array('软件教研室'=>'/home',
				'成员'=>'/member/index',
				$data['Status']=>'/member/index',
				$data['Name']=>'/member/info/AId/'.$data['AId'])
		);
	?>

	<div class="instr">
		<div class="icon">
			<input type="hidden" name="AId" value="<?=$data['AId'];?>" />
			<img src="/pub/icon/<?= $data['Icon']; ?>"
			alt="<?= $data['Name']; ?>" width="150" />
			<input type="button" value="上传新头像"
				onclick="upload_icon(<?= $data['AId']; ?>)" /> 
		</div>
		<div class="param">
			<h3>姓名：<input type="text" name="Name" style="width:70px;"
							value="<?= $data['Name'];?>" />，
				<select name="Sex" id="Sex">
					<option value="m">男</option>
					<option value="f">女</option>
				</select>，
				民族：<input type="text" name="Race" style="width:60px;"
							value="<?= $data['Race'];?>" />，<br />
				生日YYYY-MM-DD：<input type="text" name="Birth"
							style="width:90px;" value="<?=$data['Birth'];?>" />
			</h3>
			<div class="info">身份：
				<select name="Status" id="Status"
						onchange="on_change_status(this)">
					<?php if (auth::check(auth::PRIV_TEACHER)): ?>
					<option value="7">教授、博士生导师</option>
					<option value="6">教授</option>
					<option value="5">副教授</option>
					<option value="4">讲师</option>
					<option value="3">教师</option>
					<?php endif; ?>
					<option value="2">在读博士</option>
					<option value="1">在读硕士</option>
					<option value="0">毕业生</option>
				</select>
				<span id="enroll_date" style="display:none">入学时间YYYY：
					<input type='text' name='EnrollDate' 
							style='width:50px;' 
							value='<?= $data['EnrollDate']; ?>' />年
				</span>
				<script type="text/javascript">
					$("#Status").val(<?=$this->status?>);
					<?php if ($this->status<3)
							echo '$("#enroll_date").show();';
					?>
					$("#Sex").val("<?=$this->info['Sex']?>");
				</script>
<?php if (auth::check(auth::PRIV_ADMIN))
		echo "<br />排序(越大越靠前)：<input type='text' name='Sort' ".
			" style='width:30px;' value='{$data['Sort']}' />";
?>
			</div>
			<div class="info">
				简介：<br />
				<textarea style="width:400px;height:240px;"
					name="Intro"><?= $this->info['Intro'];?></textarea>
			</div>
			<div class="info">
				研究方向：<br />
				<textarea style="width:400px;height:40px;"
					name="Interest"><?= $this->info['Interest'];?></textarea>
			</div>

			<div class="separator"></div>
			
			<div class="info">联系方式：
				<table border="0" cellspacing="2" cellpadding="0"
					style="margin-left:15px;">
				<tr><td>Email:</td>
					<td><input type="text" style="width:290px;" 
						name='Email' value="<?= $this->info['Email'];?>" /></td>
				</tr>
				<tr><td>Phone:</td>
					<td><input type="text" style="width:290px;" 
						name='Tel' value="<?= $this->info['Tel']; ?>" /></td>
				</tr>
				<tr><td>MSN: </td>
					<td><input type="text" style="width:290px;" 
						name='MSN' value="<?= $this->info['MSN']; ?>" /></td>
				</tr>
				<tr><td>QQ:</td>
					<td><input type="text" style="width:290px;" 
						name='QQ' value="<?= $this->info['QQ']; ?>" /></td>
				</tr>
				<tr><td>HomePage:</td>
					<td><input type="text" style="width:290px;" 
						name='Home' value="<?= $this->info['Home']; ?>" /></td>
				</tr>
				<tr><td>Blog:</td>
					<td><input type="text" style="width:290px;" 
						name='Blog' value="<?= $this->info['Blog']; ?>" /></td>
				</tr>

				<tr><td>&nbsp;</td><td></td></tr>

				<tr><td>&nbsp;</td>
					<td><input type="submit" value="submit" />
						<input type="button" value="discard changes"
							onclick="history.back();" />
					</td>
				</tr>
				</table>
			</div> <!-- end of contact -->
			
		</div>
		<div class="clear"></div>
	</div> <!-- end of detail -->
</div> <!-- end of segm -->
</form>

<?php include 'frame-bottom.php'; ?>
